package com.example.xunai.dto.request.conversation;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class UpdateConversationRequest {
    private String title;
    private String model;

    public static UpdateConversationRequest withTitle(String title) {
        return new UpdateConversationRequest(title, null);
    }

    public static UpdateConversationRequest withModel(String model) {
        return new UpdateConversationRequest(null, model);
    }

    public boolean hasTitle() {
        return title != null && !title.trim().isEmpty();
    }

    public boolean hasModel() {
        return model != null && !model.trim().isEmpty();
    }

    public boolean isValid() {
        return hasTitle() || hasModel();
    }
}